package com.jarvis.zeng.design.pattern.simple.factory;

/**
 * @author ZengJun
 */
public class ShapeFactory {

    @SuppressWarnings("unchecked")
    public static <T> T getShape(String shapeName){
        T obj = null;
        try{
            obj = (T)Class.forName(shapeName).newInstance();
        }catch(Exception e){
            e.printStackTrace();
        }
        return obj;
    }
}
